Esc Seq Function
======= ==========================================
E[nA move cursor up n lines
E[nB move cursor down n lines
E[nC move cursor right n characters
E[nD move cursor left n characters
E[n` move cursor to character position n
E[na move cursor right n characters
E[nd move cursor to line n
E[ne move cursor down n lines
E[nF move cursor to start of line, n lines up
E[nE move cursor to start of line, n lines down
E[y;xH Move cursor to x, y E[H homes cursor
E[y;xf Move cursor to x, y
E[nZ Move cursor back n tab stops
E[nL Insert n blank lines
E[n@ Insert n blank characters
E[nM Delete n lines
E[nP Delete n characters
E[nJ Erase part or all of display:
n = 0 from cursor to end of display,
n = 1 from begin of display to cursor,
n = 2 entire display.
E[nK Erase part or all of line:
n = 0 from cursor to end of line,
n = 1 from begin of line to cursor,
n = 2 entire line.
E[nX Erase n characters
E[nS Scroll display n lines up (forward)
E[nT Scroll display n lines down (reverse)
E[nm Set character attributes:
n = 0 normal attribute (all off)
n = 1 bold
n = 4 underscore
n = 5 blink
n = 7 reverse
n = 3X set foreground color
n = 4X set background color
X = 0 black X = 1 red
X = 2 green X = 3 brown
X = 4 blue X = 5 magenta
X = 6 cyan X = 7 white
You can set more than one thing by separating them with a
semi-colon. eg. E[0;1;33;40m
E[s Save cursor position
E[u Restore saved cursor position
E means 0X1B
if n is 0 then it can also be left off
E[0J == E[J